package panel.help
{
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.geom.Rectangle;
	
	import assists.Lang;
	import assists.SizeManager;
	import assists.URI;
	import assists.resource.ResourceLoader;
	
	import inerface.IReadyPanel;
	
	import panel.viewSpots.StaticSlide;
	
	public class ReadyPanel extends Sprite implements IReadyPanel
	{
		private var _stage:Stage;
		private var _loader:ResourceLoader;
		private var _lang:Lang;
		private var _uri:URI;
		
		private var _container:Sprite = new Sprite();
		private var _itemList:Array = [];
		public function ReadyPanel()
		{
			super();
		}
		
		public function init(stage:Stage, loader:ResourceLoader, lang:Lang, uri:URI=null):void
		{
			_stage = stage;
			_loader = loader;
			_lang = lang;
			_uri = uri;
			
			_container.y = SizeManager.UpGuideHeight;
			this.addChild(_container);
		}
		
		
		public function show(dataList:Array):void
		{
			for(var i:int=0;i<dataList.length;i++)
			{
				var item:ReadyItem = new ReadyItem(_stage,_loader);
				item.show(dataList[i]);
				if(i != 0)
				{
				item.y = _itemList[i - 1].y + _itemList[i - 1].height + _stage.stageHeight * 0.02;
				}
				_container.addChild(item);
				_itemList.push(item);
			}
			StaticSlide.beginSlide(_container,_stage,new Rectangle(0,_container.y,0,-_container.height - SizeManager.UpGuideHeight - SizeManager.donwGuideHeight + _stage.stageHeight),SizeManager.UpGuideHeight);
		}
		
		public function clear():void
		{
		}
	}
}